package com.finance.cooperate.feature.core.feature;

/**
 * @ClassName FeatureOneHotType
 * @Description 特征热编码类型
 * @Author shen
 * @Date 2022/5/25 16:33
 * @Modify ...
 */
public enum FeatureOneHotType {


    ONE_HOT_FEATURE_TYPE_001("设备品牌", 1, true),
    ONE_HOT_FEATURE_TYPE_002("运营商", 2, true),
    ONE_HOT_FEATURE_TYPE_003("时区", 3, true),
    ONE_HOT_FEATURE_TYPE_004("设备国家", 4, true),
    ONE_HOT_FEATURE_TYPE_005("网络类型", 5, true),

    NULL("", 0, false);

    //描述
    private String desc;
    private int value;
    //是否进行热编码
    private boolean status;

    FeatureOneHotType(String desc, int value, boolean status) {
        this.desc = desc;
        this.value = value;
        this.status = status;
    }

    public static boolean getStatus(int value) {
        FeatureOneHotType[] featureOneHotTypes = values();
        for (FeatureOneHotType type : featureOneHotTypes) {
            if (type.getValue() == value) {
                return type.getStatus();
            }
        }
        return false;
    }

    public int getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }

    public boolean getStatus() {
        return this.status;
    }

}
